import QtQuick
import Qt5Compat.GraphicalEffects
import DelegateUI

Item {
    id: control

    property alias sourceItem: __source.sourceItem
    property alias sourceRect: __source.sourceRect
    property alias opacityNoise: __noiseImage.opacity
    property alias radiusBlur: __fastBlur.radius
    property real radiusBg: 0
    property color colorTint: "#fff"
    property real opacityTint: 0.65
    property real luminosity: 0.01

    ShaderEffectSource {
        id: __source
        anchors.fill: parent
        visible: false
        sourceRect: Qt.rect(control.x, control.y, control.width, control.height)
    }

    FastBlur {
        id: __fastBlur
        anchors.fill: parent
        source: __source
        radius: 32
    }

    Rectangle {
        anchors.fill: parent
        color: DelThemeFunctions.alpha("#fff", luminosity)
        radius: control.radiusBg
    }

    Rectangle {
        anchors.fill: parent
        color: DelThemeFunctions.alpha(colorTint, opacityTint)
        radius: control.radiusBg
    }

    Image {
        id: __noiseImage
        anchors.fill: parent
        source: ""
        fillMode: Image.Tile
        opacity: 0.02
    }
}
